add validation in purchase directive