changing the constructor
bug correction