fixed else statement, for #1877