introduce error_callback to ease error logging
eliminate warning