add general exception handling