changed to jquery .ready function.