Added task_free and fixed uploading bug