added logic for iv if present