fix some glitches for authentication