fixes folding in js