Fix for 'Notice: Undefined index'