Debug drag

Now can detect top and bottom is out of boundary correctly