added logic for changing source of sound