Fixed broken if statement