Listen on 'online' event instead of on 'message' event