improved error checking and tidy ups for GData spike