Setting functions outside of document ready