added cleanup command so resources get cleaned up if a user closes a tab