added if condition 

added if condition