fixed some bugs for main page