Add support for attach and detach device