fixed bug in upload resources and added refresh