Fix attaching behavior via config

Fix #146