Updated to be compatible with WP v4.1