fix the condition when user.uid not exist