fix LocalService class cast bug