bug fix and add perofrmance