Makes error only show during appropriate times