fix upload handling