Solved the undefined index