Fixed issue-40 and issue-41