Fix context check