added if/then statements to check