wrong function bug fix