fix a bug on the unautorized entry point