variable inside if bracket

Is this possible? The below code not working for me.

dir=mydir
 if [ -d /home/$mydir ]; then 
       echo "found /home/$mydir "
 else 
       echo "Not found /home/$mydir"
fi

---------- Post updated at 05:28 AM ---------- Previous update was at 05:25 AM ----------

Its working for me now

It was no big problem I guess, but keep in mind to post your solution, when you found one.
This forum is for the benefit of all, not just you. Ok?!