Fixing bug with mongoose