passing key and parent object