remove unecessary files
improve error handling