added some checks so header.php wont interfere with any other app