implemented simple dfd chain promise
fixed querying logic