added test for attach method