Added some exception handling to service