fixed splicing bug when not sorting values