Adding check for empty $uids var