check the direction