Issue #13 Fix undefined index