Update check.php

changed checker logic