change contructor to be more NPE proof