the method add validates the string accepts \n