fixbug for unlinking host's templates