put error function back into the proper scope