better error handling. report errors to user.