better upload handling