Fixed templates bug after jquery update