updated to work with newer installs of WP