Replaced match with if.