Added lambda functions to the exit function in the Sound class