fix issue where upload pdf and upload image does not work at time