fix crash
fix loading of resources