Fixed the checks order