fixed bug in rotation matrix