fix bug with empty fields