improve event listening registration for onload
adding improved version of app from demo 01
fixing error in demo