resolved issue #27 and issue #38