resource management with promise
Merge pull request #6 from hden/promise

resource management with promise