Revert "a bug in the order of authentication"

This reverts commit dcc5aed1a33a67a86ec7d64c7fe69fce0ec78840.
heuristic method of determining when to die