fix getRelativeDirection