obs_error function not doing what I want