move check_uid to uid.c