choose sid dynamically