fixed delete_algorithm and all the queries for status <> 0