fixup a bug for binary rewritting