handle errors on server better