change error function from protected to public