fix #69
minor optimization