added registerAccount function