Fix error in draw logic