fixed bug in gather.py