ifelse was broken