fixing #146

@dwightguth @andreistefanescu please review