Added code for refreshing view on dragging