add admin function and a redirect function