add check dir and full_path function