added to fix a bug in main page and added tests