Fixed replace bug in resource_manager