modified to detect modernizr