Added updated LoginManager code with updated code I received from Scott. Shouldn't break anything that wasn't already not functioning, apologies if it does