fixed issue when using array helper with .then with functions that are ran immediately