Fixing a potential bug in the accept invitation