savepoints fixed, counter implemented