Fix broken if statement