added functionality for cleanup