Fix that happen not expected results in case of attach-to-detach