Dont write user added scripts directly to the index, make them pending approval