change errors list to not be global