fixed custom field id retrieval logic