Tweaked check.php