updated to work with latest apx