changed variable name and added if conditional.