fixed for issuess #8 and #9