How to fix Freeze in EDT

Just thought I link this here, as it might help people visiting this thread: