fixed compiler warning
use function