Added hacky hooks to frame creation and deletions.

This needs to be a bit tidier but it works for now.