Still some bugs in roll_back function