Added contextId to the global variables.