listener now fired only on state change
Merge pull request #36 from WickyNilliams/addListener-issue35

listener now fired only on state change fix for #35