changed logic for adding values into ERRORS array