fixing issue with autopopulate script