alternative patch in response to pull #161