Fixes undefined index error.