fixed log in bug and separated account functions to a module