Eliminate undefined index error