added update functionality and bugfixes