fixed unwrap bugs