Added getLastUid function.