fix typos
refactor insertByAll condition