fix possible npe inside service class name #238