fixes issue #27, thank you @megagumbo