implement command handler