added error handling
removing junk