ref #4165 - bug fixing