fixing values rem

issue #1158