fix template bug of context