Fixing the "Undefined index: #markup" error