replace errors with getErrors