added q library for promise handling