Solve template dispatch on ajax request