Fixes #158. Needed a Platform.flush() for the overlay