fix bug for wrong url, add login and register for unlogined user