Removes default value from optional parameter and check against undefined instead