moved resource hooks to event