fixed a bug into the constructor