fix error

fixed using wrong function