Implemented function promise support