Compare current post Category in select menu

OMG – i falied to clean “$selected” value… hope this helps someone
if you get confused for a moment like i did

<?php 
$postId = $_POST['postid']; // the value is recieved properly
$currentCategory = get_the_category($postId);  // the value is recieved properly
$currentCategoryId = $currentCategory[0]->term_id; // the value is assigned properly

$categories = get_categories('hide_empty=0'); // the value is recieved properly
$optionname = "postcats"; // the value is recieved properly
$emptyvalue = "";

// SELECET DROP DOWN TERMS
echo '<select name="'.$optionname.'" class="clientList"><option selected="'.$selected.'" value="'.$emptyvalue.'">'.__('Choose a category','sagive').'</option>';
foreach($categories as $category){

    // HERE I ENTERED AN ELSE THAT WOULD CLEAN
    // THE VALUE OF $SELECTED

    if($currentCategoryId == $category->term_id) {$selected = 'selected="selected"';} else {$selected = ''}
    echo '<option name="'.$category->term_id.'" value="'.$category->term_id.'" '.$selected.'>'.$category->name.'</option>';
}

echo '</select>';
?>