add better_error to improve error catch