misplaced else corrected