added secret key functionality