added two for loops to loginStatus 1 3