Fixes dialog hiding so it doesnt block the UI

The dialogs do not hide properly, they're still drawn just invisible. This hides them properly.