Added template check