fixed issue #13, #14, #15