fixing issue 995

@dwightguth please review