fixing context loss problems