added check for empty table with override procedure to start from scratch when filling trades