fixes #233 - template race condition.