fix quantity validation