Changed secret key logic.