fixed drag listener code