Added failure callback to waitFor