changed updateResources function to work everytime (hopefully)