fixed attach.py