add support for angular and jQuery promises