fix bugs with drawing + rendering logic