fixed problem with resoure download logic