bug fix for dragging