fixed bug in adminError function