bug in local template check