Bug fix: use the right function