add some function for the main activity