will you have race condition issues if you don't wrap all this in a `$(document).ready(function() {` ?