fixed plugin ordering issue, added sanity check to functions.php