closed #391 and #392