fixed a problem with the constructor