[Fix #1] Add onEnd callback when commands are executed