switched js/jq back to onready, but placed script at end of index.html which seems to solve issue