fixed checking for check bug