Updated files with error catching