removed unnecessary clearError()