fixed bug with rotation angle exeeding 360 degrees