updated the execute command method