add error log
refactor replace-let in L5