fix errors because of ==null