add an else branch to fix a bug