added tenary check to variables