Added an else to avoid unnecessary checking.