added g:if and moved outside li element