codecleaning and bugfixing on attribute event on datasource