Fixed code for main page