fixing bug with drawing