Fixed the broken while loop, so password checking works properly