fixed logic for front page