added error checking to prevent deleting uncompressed files