Fixed a bug in template timeout setting