context setting bug fix