rename handleSession to handleCommand.