working code for SNS and SQS