fix template requirement bugs