Added homepage redirect logic