Changes in prototype factory

Added parent constructor call