Beginning to add some error handling