fixed undefined context error