make Firefox compatible
add caching of templates
fixed tracking of errors