unexpected identifier while compiling ejs

I get the titled error when trying to compile the following

<table>
        <tr >
          <th>First Name</th>
          <th>E-mail</th>
          <th>Last LogIn</th>
        </tr>
        <% for(var i=0; i < users.length; i++) { %>
            <tr>
                <td><%= users[i].name.trim() %></td>
                <td><%= users[i].email.trim() %></td>
                <% if users[i].lastLogIn.trim() !== null %>
                <td><%= users[i].lastLogIn.trim() %></td>
                <% else %>
                <td><0></td>
                <% endif %>
            </tr>
            <% } %>
    </table>

can i get help please