fix compatibility issues with WP < 3.5