index.php

make index more robust