trying to handle redirect loop
debugging
revert debugging
even better login check