fix template manager