Changing reference when creating sessions