fix returning in the right context