fix some bug in dialog's drag