changed admin check to loginproc