Changed negative if condition to unless