complete alterContext method
add second solution for flow control