add rotation detection