Change mkdir to mkdir_p in case tmp does not exist