fix bug with errors and custom fields