fixes #77 State of component is correctly stored in javascript object