added validation to store method