replaced deprecated calls to get_context_instance