fixing placement of esr code