fixed bug in restitute.py