fixed problem with validation