test context before accessing it