check if file exist before deleting