add a little client side error check