call class constructor when class is defined