Wrote get_error check