Fix that incorrect results in case of detach-operation