added saveTempAI function and to add temporary sample submission