fix secure and authorize