fixing bug #5959