cleanup and check