solving the twice login issue