fixed compatibility with wp 4.x