Improved dragging functionality