improve arch detection