replaced {'class': xxx} with addClass; refer to issue#2
merge and fix for issue#2