fixed typo with if statement
fixed typo with queryBuilder
fixed typo with endfor