bugfix: wait for resources to be loaded