fixed small function error