additional fix for issue #280, pass defer to nested context