added condition parameter for desctroy method