Added additional file check & exception handling