added a check that the construtor is indeed a function