Fixed nil id problem in index