Added a this reference to the errorMessage function