fixes issue #15
More sophisticated solution may in later version
Resume