redirect to login
more foreach alterations