add error handeling for uploads