fix bug in constant folding