fixed mkdir to take permissions as 2nd arg