fix broken if statement