fixed wrong function