added aps-based callback to programs so that they can wait without blocking other things