fixed #9 and fixed #24