Moved function call into DOM ready function.