added some safer logic to receiving and uploading snaps