added check to see if file exists before gzipping