fixes to resources loading