fix #14
improve #27