when close the main frame will close all windows