Added thread functionality.