save main context after merging temp changes