Add OnConnect and OnFrame methods