add script and print error while insert