fix syntax error: add end keyword
remove dead code: DOL logic is only applied in one place