added quantity check