add check can write dir