added exception handling in clients