updated to allow auto templates