added invalid cart handling