added error handling for invalid sounds