adding conditional logic before playing audio