security context bug fix