fixing bug #5174 by using right method