Added OnClose condition, and updated/fixed JSON