detect login on homepage and optimize imports