implemented potential fix for #669