Added a check to see if the specified file exits.