admin function bug fix