added error checking callbacks