Changed the fileparts function call so it shouldn't throw an error