Added 'is client alive' check