added rewriting loginlink, so that all logins are correct