fixed bug with resources