Rewrote some code as the previous one was faulty. Tested out the new code and it works so far for both the username and password being correct.