fan under hood fails to turn off after 1hr when ignition is off. on 2002 BMW 540i

Presumably the cooling fan under hood on passenger side fails to turn off after 1 hour when ignition is turned off blowing air into car under both driver and passenger front seats. Needed to disconnect battery.

Asked by for the 2002 BMW 540i