fixed a bug in last authentication refactor