Run code depending if the optional parameter has been passed