fix initialization order bug with mongoose schema