implemented client.context and spawning