bug fix for checks function