moved context to global variable