Beginning to add improved error handling