working with mongodb, bugfixes