fix some issues for main activity