Adding the option for "auto close" for pencil tool