Fix upload permission bug