more clean up and error checking