Fixing if bug in check.sh