authentication and mongodb fixes