Added try/catch statement around file creation function. Still incomplete.