reverting buggy changes to else-if