add error handling for aplayer