bug fix on drag event