Refactored code and removed / from cmd topic name in test.