Fixing ajax templating