added ensureIndex to when field on loginTokens