fix bug: nil instance and not check err