added drag detection