check for remaining items and exit on zero
dispose frame instead of exit on zero items