enabling optional context to make it work with modal windows