I found the problem! it was missing the if statment

if (menu_header_visible('Tools')=='true')

It is working fine now.

Thanks All