added option to turn off document ready wait