added fix for nullpointer exception in overriding constructor