resolve #1349

Could be written better but shows how to do it.