fixed typo in function