fix #259 and #260