home page logic