fix bug introduced with wrap() context changes