Added check to getField if the key isset to prevent Notice: Undefined index

This check is needed because there is no way to check if a field exists.