implemented hotizontal and vertical locking when dragging start