Better handling of invalid client