Fix multiple upload bug ([Error: Can't set headers after they are sent.])