improving validation of dispensing form