Changed the $userId variable to get the ID from the session