fix a bug on drag