fixed bug in rotation