raises error if prices mismatch
rejigged to check price immediately after taking input