Added autoAttach option, defaulted to true