Fix code on home page and header to correct if statement