Fixed define & if logic