fix invalid uid behavior