added tests and catch errors where 0 quantity is given