added mongodb-based login check