Add afterOpen callback