Fixed getClient() function