fixed #135, #142, #143