finalize SMS function