fix error checking on initialise