Updated index.py to handle no link case