Automatically shutdown context after simulation
Improve fourth solution