maybe "onMessage" is not needed here because we're not supposed to call it from the outside