Change createClient from async to sync