update algorithm for loginas