putting import rc_context in try/except block