Fix bug to getting all fields for class