added if conditional

added if conditional