bug fix, calling wrong function