fix drag code