Error handling at sent and viewq

Inside catch blocks we call terminate()
Edited answer.php

Added another try-catch block
Fixed small mistake from
a052d2b6de2097be357aba655656d87c07ac3c76