rewrite attach method to throw Exception