Removed detach() call in test case