correct context in function