add loadapp function and change the layout to gridview