Rewrite client and fix no topic error on server