fix bug when hiding notice
add compatibility with WP 3.9