fixed undefined variable in case of drawing by points