fixed another bug in prediction routine