fixed #14, fixed #15, fixed #16