fixed problem at extremes of rotation