Fixed an error by adding a missing else clause.