fail to work
fix syntax error
Add drag direction check and handle function