Added reset context logic.