fixing bug given by J-M Morel bug