Hiding the Navigation Menus - except for logged in users

Created a custom block with the below php code and then disabled the drupal built in navigation block
<?php global $user; if ($user->uid) { if ($menu = menu_tree()) { echo ""; echo "
- ";
print $menu ;
echo "