corrected use of function