Adding to cart after error

Our client found that after error (i.e. adding to cart is not valid) and fixing these errors clicking on add to cart adds product properly, but because referer is not set correctly jigoshop redirects to homepage instead of product page.
Fixed this by adding additional redirect after error is set.