removes path and markers onDetach