update secret logic