fix ajax refresh of template