if you're doing asynchronous stuff in a function you should pass in another callback to that function for when it's finished