Fix bug #24 and #25
updated