fixed issue of invalid initialisation of member variable