close event for wp