add race detection to tests
make main compile