tiny fix on direction check