bug fix and new interface