fixed #25. Not sure if it can fix #24.