Fixed undefined index issue
Merge pull request #1 from IanSchweer/master

Fixed undefined index issue