print errors with err function