added app mode check in mongodb connection