Moved domain & scheme check
minor fixes