Revert "remove unnecessary else branch"

This reverts commit 4989066275373e47ae3a14af4854a30717d0194e.