Fixed typo where function was not being called