modified playSound method