added ws code to index.php