Add callback for socket