Don't call the functions inside the call to .then() but within the .then's callback

Signed-off-by: Tomas Neme <lacrymology@gmail.com>