fix a check function bug