fixed a bug in the thread block