bug fix in drag event(more robust)