fix some potential error