The ul needs to be started outside of the if above for this li tag to be contained within a ul, otherwise you'd get malformed HTML.