upload functions enhanced