added functionality to cancel sound by pressing x