fixing resources bugs