fixed foldl bug