error handling and loading time cleanups