added clean up method to resources