fixed a bug with the dimension