small bug fix, had the wrong context in a function