remove finished contracts from db