fixed calling wrong function