Fixed datatables and sidebar logic