Added correct delete where handling