move ghosts variable into dragEnd method