Added error checking and FilePath