Use a function to chain sendCommands method