improve client validation