fixing rotation bug with offsets