added in a try/catch statement for the file stuff