fixed constructro function