Added validation error functionality