Moved from file_exists to is_file, its faster and more accurate than file_exists in this case - fixed possible bug