changed way of creating $check_target variable

fixing the (security) problem that the file temporary file '._check_~.ok' was created in the root directory and being readable for all.