improving dispensing validation