Fixed bug undefined index