fix error tempalte with bootstrap alert
only show tempalte for ajax requests