Move BAE secret into try catch block