restore login method
jung's fixes