ifelse fixes