fix delete condition