fix #15 and fix #7 divided to #14