Fixed issue #1 and #2, refer to body

fixed #1  and fixed #2