fixing the rotation bug