Code Error cmd.getClass().getName() replaced with cmd.getName()