Corrected check.php code