Fixed issue in attachTo