Fixed performance issues with the demo