enhanced previous fix to bug #120684, using excellent suggestion by Daniel