Add check for mkdir