fixing bug #4389
fixing bug #4378
fixing bug #4459