added clean up mechanism