working login and register except twice run does not work