Fixed issue with .error not being defined