added logging
added custom jinja 2 filter