Dispatcher.cs modification