add login and fix error error in template