added error condition for consume