moved drag code to update