added check for playing sound