bug fix.  Close #957