Fixing refreshTable bug