hoist sloc check out of the loop in main.d