Fixed wrong function called