fixed incorrect reference to main_window