modified to adapt to demo configuration