Fixing issue with sorting table inside table