move system check to main