add check for mkdir