updated demo and fixed some logic in the loader js