Fixing crash when fields are empty