added conditional statement