resolve issue #30 and issue #31