check for file exists before running command
used correct ruby syntax