fixed issues with context chaining