BMW recalls more than 300,000 cars which are at risk of malfunctioning