added some error handling
deleted redundant file