updated sms handling and database