bug fix and add free