fixing rotate problem