Add attach functionality.