Fix main windows close bug and add data grid