Modified to use user_id of session instead of agent_id parameter.