add account logic and bug fixes