Use smarter file exists check instead of cat

Per @thelastcicada, this is a much smarter (and easier) way of checking if the file exists