Fixed a bug where rotation was wrong