added error checking when playing sounds