Error handinling on client side