update stop process to handle presence of queued messages just in case, tidy up a little for clarity