fixed bug in resource_registered method