Fixing bug where login form would sometimes hang, closes #39