fixed bug #61 #56

fixed the bug #61 and #56