fixed SMS message to only send one message, misc fixes & optimizations