added conditional check for opp