Make main_ui be heap allocated