fixed a silly bug i introduced on the last push. on_load didnt check document type, but now it does