Removed deprecated function call.
Bugfix, wrong variable name.
Check for the variable existence using isset.