fixed sent messages bug and added patient appid to message cell and detail