fix for invert section
do feature scan first (later can use this to optimize php code