Fixed the JS login functionailty;