Moved initData to within if statement in LogIn