Get userId from session correctly