fixed bug when fieldname does not exist