maybe wrapping it in a .ready() call will work?