Fixing context not being set properly