Added decode to seperate thread