getIndexById now returns -1 as expected instead of undefined, function on first exec promise now has much better suited condition