add file_exists cache & fix bug in loadfile