adding check for loading darwin correctly