added functionality to clear errors