Error message functionality updated