made C variants for handleMessage and putFailed