fix error message and relative template path