try to fix scan problem with nil values