add error handling for field