fixed bug with dependent destroy