check if file_exists as an attempt to avoid mkdir race condition #1