still trying to figure out how to wait until javascript libraries are loaded