double $uid bug fix