fix wrong function being called