Move check to a proper place