prevent valuerror