Fix some bug and update table states