fix upload and delete bugs