bugfixes, added rollback support