corrected function passing