this needs a callback in order return the value from getPending