adding error toggle