fixed clearing of the stack upon save()