available qty validation. Fixes #1045