fix js validation errors handling