located bug in rewriteValue
fixed value rewrite bug