Using direction to preventDefault