added check for file existence before file delete