FIX memory leak because dettached element on inline function

remove debug code please