homepage logic