Updated check out process to be able to handle errors