Removed undefined index error